package collections

class AddAllTestDemo {

}

fun main() {
    val list1 = ArrayList<String>()
    list1.add("A")
    list1.add("B")
    list1.add("C")
    list1.add("D")

    val list2 = mutableListOf<String>()

    Thread {
        list1.removeAt(0)
        println("")
        println("list1:")
        list1.forEach {
            print(it)
        }
        println("")
    }.start()

    list2.addAll(list1)
    println("")
    println("list2:")
    list2.forEach {
        print(it)
    }
    println("")
}